home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / src / binutils.252 / gas / config / obj-elf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-08  |  3.9 KB  |  123 lines

  1. /* ELF object file format.
  2.    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
  3.  
  4.    This file is part of GAS, the GNU Assembler.
  5.  
  6.    GAS is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 1, or (at your option)
  9.    any later version.
  10.  
  11.    GAS is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with GAS; see the file COPYING.  If not, write to
  18.    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. /* HP PA-RISC support was contributed by the Center for Software Science
  22.    at the University of Utah.  */
  23.  
  24. #ifndef _OBJ_ELF_H
  25. #define _OBJ_ELF_H
  26.  
  27. #define OBJ_ELF 1
  28.  
  29. #include <bfd.h>
  30.  
  31. #define BYTES_IN_WORD 4        /* for now */
  32. #include "../bfd/libelf.h"
  33.  
  34. /* Use this to keep track of .size expressions that involve differences
  35.    that we can't compute yet.  */
  36. #define OBJ_SYMFIELD_TYPE expressionS *
  37.  
  38. /* Symbol fields used by the ELF back end.  */
  39. #define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset;
  40.  
  41. /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead.  */
  42. #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
  43.  
  44. #include "targ-cpu.h"
  45.  
  46. #ifndef FALSE
  47. #define FALSE 0
  48. #define TRUE  !FALSE
  49. #endif
  50.  
  51. /* should be conditional on address size! */
  52. #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
  53.  
  54. #define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size)
  55. #define S_SET_SIZE(S,V) \
  56.   (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V))
  57.  
  58. #define S_GET_ALIGN(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_value)
  59. #define S_SET_ALIGN(S,V) \
  60.   (elf_symbol ((S)->bsym)->internal_elf_sym.st_value = (V))
  61.  
  62. extern asection *gdb_section;
  63.  
  64. #define obj_frob_file()    elf_frob_file()
  65.  
  66. extern void elf_frob_file PARAMS ((void));
  67. extern void elf_file_symbol PARAMS ((char *));
  68.  
  69. extern void obj_elf_section PARAMS ((int));
  70. extern void obj_elf_previous PARAMS ((int));
  71. extern void obj_elf_version PARAMS ((int));
  72.  
  73. /* BFD wants to write the udata field, which is a no-no for the
  74.    globally defined sections.  */
  75. #define obj_sec_sym_ok_for_reloc(SEC)    ((SEC)->owner != 0)
  76.  
  77. /* When setting one symbol equal to another, by default we probably
  78.    want them to have the same "size", whatever it means in the current
  79.    context.  */
  80. #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \
  81.   S_SET_SIZE ((DEST), S_GET_SIZE (SRC))
  82.  
  83. /* Stabs go in a separate section.  */
  84. #define SEPARATE_STAB_SECTIONS
  85.  
  86. /* We need 12 bytes at the start of the section to hold some initial
  87.    information.  */
  88. extern void obj_elf_init_stab_section PARAMS ((segT));
  89. #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
  90.  
  91. /* For now, always set ECOFF_DEBUGGING for a MIPS target.  */
  92. #ifdef TC_MIPS
  93. #define ECOFF_DEBUGGING
  94. #endif
  95.  
  96. #ifdef ECOFF_DEBUGGING
  97.  
  98. /* If we are generating ECOFF debugging information, we need some
  99.    additional fields for each symbol.  */
  100. #undef TARGET_SYMBOL_FIELDS
  101. #define TARGET_SYMBOL_FIELDS \
  102.   ELF_TARGET_SYMBOL_FIELDS \
  103.   struct efdr *ecoff_file; \
  104.   struct localsym *ecoff_symbol; \
  105.   valueT ecoff_extern_size;
  106.  
  107. /* We smuggle stabs in ECOFF rather than using a separate section.
  108.    The Irix linker can not handle a separate stabs section.  */
  109. #undef SEPARATE_STAB_SECTIONS
  110. #undef INIT_STAB_SECTION
  111. #define OBJ_PROCESS_STAB(what, string, type, other, desc) \
  112.   ecoff_stab ((what), (string), (type), (other), (desc))
  113.  
  114. #define OBJ_GENERATE_ASM_LINENO(filename, lineno) \
  115.   ecoff_generate_asm_lineno ((filename), (lineno))
  116.  
  117. #endif /* ECOFF_DEBUGGING */
  118.  
  119. extern void elf_frob_symbol PARAMS ((struct symbol *));
  120. #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp)
  121.  
  122. #endif /* _OBJ_ELF_H */
  123.